(defun insert-bean (type name value)
  (interactive "sType of bean: \nsName of bean: \nsDefault value of bean: ")
  (save-excursion
    (insert type " " name " = " value ";\n\n")
    (insert type " get" (capitalize name) "()
{
   return " name ";
}\n\n")
    (insert "void set" (capitalize name) "(" type " value)
{
   " name " = value;
}\n\n")))

(defun compile-and-run ()
  (interactive)
  (with-temp-buffer
    (async-shell-command "sh /Users/Feuer/Ohjelmointi/memapper-mvn/run-and-compile.sh")))

(defun sout (string)
  (interactive "sMitä tulostetaan: ")
  (insert "System.out.println(\"" string "\");"))

(add-hook 'malabar-mode-hook
     (lambda ()
       (local-set-key (kbd "C-x C-i") 'insert-bean)
       (local-set-key (kbd "C-x C-r") 'compile-and-run)))
(global-set-key (kbd "C-x C-r") 'compile-and-run)

(global-set-key (kbd "C-c C-p") 'sout)

(provide 'f-java)

